package com.athuiju.servicebase.exceptionHandler;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor //生成有参构造方法
@NoArgsConstructor  //生成无参数构造
public class HuiJuException extends  RuntimeException {

    @ApiModelProperty(value = "状态码")
    private Integer code;
    private String msg;//msg是我自己设置的异常信息，还有一个getMessage()方法是获取java抛出的异常信息

    @Override
    public String toString() {
        return "HuiJuException{" +
                "message=" + this.getMessage() +
                ", code=" + code +
                '}';
    }

}
